package com.zzyl.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.zzyl.dto.NursingProjectPlanDto;
import com.zzyl.entity.NursingProjectPlan;
import com.zzyl.mapper.NursingProjectPlanMapper;
import com.zzyl.service.NursingProjectPlanService;
import com.zzyl.vo.NursingProjectPlanVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class NursingProjectPlanServiceImpl implements NursingProjectPlanService {
//    @Autowired
//    private NursingProjectPlanMapper nursingProjectPlanMapper;
//
//    /**
//     根据id查询护理计划
//     */
//    @Override
//    public NursingProjectPlanVo getNursingPlanById(Integer id) {
//        return nursingProjectPlanMapper.searchNursingProjectPlanById(id);
//    }
//
//    /**
//     修改护理计划
//     */
//    @Override
//    public void updateNursingPlan(Integer id, NursingProjectPlanDto nursingProjectPlanDto) {
//        NursingProjectPlanVo nursingProjectPlanVo = nursingProjectPlanMapper.searchNursingProjectPlanById(id);
//        if (nursingProjectPlanVo != null) {
//            NursingProjectPlan nursingProjectPlan = BeanUtil.toBean(nursingProjectPlanDto, NursingProjectPlan.class);
//            nursingProjectPlanMapper.updateNursingPlan(id,nursingProjectPlan);
//        }
//    }
//
//    /**
//     删除护理计划
//     */
//    @Override
//    public void deleteNursingPlan(Integer id) {
//        nursingProjectPlanMapper.deleteNursingPlan(id);
//    }
//    /**
//     启用或禁用
//     */
//    @Override
//    public boolean enableOrDisable(Integer id, Integer status) {
//        // 查询计划是否存在
//        NursingProjectPlanVo nursingProjectPlanVo = nursingProjectPlanMapper.searchNursingProjectPlanById(id);
//        if (nursingProjectPlanVo == null) {
//            return false;
//        }
//        nursingProjectPlanMapper.updateStatus(id, status);
//        return true;
//
//    }
}
